<template>
  <div>
    <vue-preview :slides="slide1" ></vue-preview>
  </div>
</template>
<script>
  import { Toast } from 'mint-ui'
  import comment from "../subcomponents/comment.vue";

  export default {
    data() {
      return {
        // id: this.$route.params.id, 
        photoinfo: {},
        slide1:[ ],
        p: parseInt(Math.random()*10)
      }
    },
    created() {
      this.getslide1();
    },
    methods: {
      getslide1() {
        this.$http.get("https://www.apiopen.top/meituApi?page="+this.p).then(res=>{
          if (res.body.code===200) {
            // this.slide1 = res.body.data
            res.body.data.forEach(element => {
              element.w =600;
              element.h = 400;
              element.msrc = element.url;
              element.src = element.url;
            });
            this.slide1 = res.body.data;
          }else{
            Toast("获取图片失败o(╥﹏╥)o");
          }
        },(err)=>{
          Toast(err);
        })
      }
    }
  }
</script>

<style>
  .my-gallery img {
    width: 100px !important;
    height: 100px;
    box-shadow: 0 0 8px #999;    
    margin: 9px;
  }
  figure {
    margin: 10px !important;
    display: inline-block !important;
  }
</style>
